/***
 * * PROJECT
 * *    ATaG
 * * VERSION
 * *    $Revision: 1.3 $
 * * DATE
 * *    $Date: 2007/01/29 18:44:10 $
 * * LOG
 * *    $Log: SetAttribute.java,v $
 * *    Revision 1.3  2007/01/29 18:44:10  lmottola
 * *    Debug info added.
 * *
 * *    Revision 1.2  2007/01/29 17:48:00  lmottola
 * *    Added debug info in toString() method.
 * *
 * *    Revision 1.1  2006/11/03 23:09:35  lmottola
 * *    Changed nodeAttributes package.
 * *
 * *    Revision 1.2  2006/10/27 00:18:03  lmottola
 * *    New constructor added.
 * *
 * *    Revision 1.1  2006/10/24 19:01:00  lmottola
 * *    Added attributes and predicates.
 * *
 * *
 * *   ATaG (Abstract Task Graph) - Data-driven Macroprogramming for
 * *                                Sensor Networks
 * *
 * *   This program is free software; you can redistribute it and/or
 * *   modify it under the terms of the GNU General Public License
 * *   as published by the Free Software Foundation; either version 2
 * *   of the License, or (at your option) any later version.
 * *
 * *   This program is distributed in the hope that it will be useful,
 * *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 * *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * *   GNU General Public License for more details.
 * *
 * *   You should have received a copy of the GNU General Public License
 * *   along with this program; if not, you may find a copy at the FSF web
 * *   site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
 * *   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * *   Boston, MA  02111-1307, USA
 ***/

package atag.runtime.ln.nodeAttributesForGUI;

import java.util.HashSet;
import java.util.List;

public class SetAttribute extends NodeAttribute {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public SetAttribute(String key, Object[] values) {

		this.key = key;
		HashSet container = new HashSet();
		for (int i = 0; i<values.length; i++) {
			container.add(values[i]);
		}
		this.value = container;
	}
	
	public SetAttribute(String key, List values) {
		
		this.key = key;
		this.value = new HashSet(values);
	}
	
	public String toString() {

		return "SetAttribute key = " + key + ", value = " + value;
	}
}
